package com.goldcn.enumeration;

import com.google.common.base.Objects;

/**
 * Created by Administrator on 2016/8/24.
 */
public enum CommissionEnum {
    oneAgent(1,"一级代理商分成"),
    twoAgent(2,"二级代理商分成"),
    threeAgent(3,"三级代理商分成"),
    storeManagerCommission(4,"店长佣金"),
    salesManagerCommission(5,"店员佣金"),
    salesCommission(6,"顾问佣金"),

    platAdd(7,"平台加价"),
    platDeduction(8,"平台扣点"),
    transactionFee(9,"手续费"),

    shopProfit(10,"商城利润");


    private Integer code;

    private String msg;

    CommissionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static CommissionEnum valueOf(Integer code){
        for(CommissionEnum commissionEnum:values()){
            if (Objects.equal(code,commissionEnum.getCode())) {
                return commissionEnum;
            }
        }
        return null;
    }


}
